package com.yc.cloud.openai.portal.enums;


import lombok.Getter;

import java.util.Objects;

@Getter
public enum TextToImageProvider {
    //这里的value值需要跟CLIENT_NAME保持一致,@Component("CHAT_TTS") ChatTTSClient
    STABLE_DIFFUSION("1", "STABLE_DIFFUSION"),
    COMFY_UI("2", "COMFY_UI");

    private final String key;
    private final String value;

    TextToImageProvider(String key, String value) {
        this.key = key;
        this.value = value;
    }


    public static TextToImageProvider fromKey(String key) {
        for (TextToImageProvider provider : TextToImageProvider.values()) {
            if (Objects.equals(provider.getKey(), key)) {
                return provider;
            }
        }
        throw new IllegalArgumentException("Unknown provider key: " + key);
    }
}

